//
//  HLRecordListRequest.m
//  YueYue
//
//  Created by hulu001 on 2023/6/15.
//

#import "HLRecordListRequest.h"

@implementation HLRecordListRequest


- (instancetype)init
{
    self = [super init];
    if (self){
        self.page = 1;
    }
    return self;
}

- (NSString *)requestUrl
{
    return @"/user/video/call/record";
}

- (YTKRequestMethod)requestMethod
{
    return YTKRequestMethodGET;
}

- (id)requestArgument
{
    return @{@"pageNum":@(self.page),
             @"pageSize":HLListPageSize};
}

- (NSArray <HLRecordModel *> *)recordList
{
    NSArray *lists = @[];
    NSDictionary *data = [self.result valueForKey:@"data"];
    if (![data isKindOfClass:[NSDictionary class]]){
        return lists;
    }
    
    NSArray *records = [data valueForKey:@"records"];
    if (records.count > 0) {
       lists = [HLRecordModel mj_objectArrayWithKeyValuesArray:records];
    }
    
    return lists;
}


@end
